<!--<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>-->
<!--<%@ taglib prefix="s" uri="/struts-tags"%>-->
<!--<%-->
<!--String path = request.getContextPath();-->
<!--String basePath = request.getScheme() + "://"-->
<!--+ request.getServerName() + ":" + request.getServerPort()-->
<!--+ path + "/";-->
<!--%>-->

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <base href="<%=basePath%>">

    <title>编辑用户</title>

    <meta name="pragma" content="no-cache">
    <meta name="cache-control" content="no-cache">
    <meta name="expires" content="0">
    <link th:insert="~{views/script :: tiancai}"/>
    <!--    <%@include file="../../script.html"%>-->
</head>

<style type="text/css">
    .myselect {
        height: 30px;
    }
</style>

<body>
<section class="info-section">
    <form id="form" method="post">
        <table>
            <tr>
                <td class="text-title">字典类型名：</td>
                <td class="text-content">
                    <input type="hidden" name="id" >
<!--                    <input type="hidden" name="createBy" >-->
                    <input type="text" name="typeName"
                           class="easyui-textbox theme-textbox-radius" data-options="required:true">
                </td>
            </tr>

            <tr>
                <td class="text-title">字典类型编码：</td>
                <td class="text-content">
                    <input type="text" name="typeCode"
                           class="easyui-textbox theme-textbox-radius" data-options="required:true">
                </td>
            </tr>
            <tr>
                <td class="text-title">备注：</td>
                <td class="text-content">
                    <input type="text" name="typeNote"
                           class="easyui-textbox theme-textbox-radius" data-options="required:true"></td>
            </tr>

            <tr>
                <td class="text-title">排序编号：</td>
                <td class="text-content">
                    <input type="text" name="sortNum"
                           class="easyui-textbox theme-textbox-radius" data-options="required:true">
                </td>
            </tr>
            <tr>
                <td class="text-title">状态：</td>
                <td class="text-content">
                    <select name="status" class="easyui-combobox theme-textbox-radius">
                        <option value="1" >正常</option>
                        <option value="0" >禁用</option>
                        <option value="2" >已删除</option>
                    </select>
                </td>
            </tr>

            <tr>
                <td colspan="2" style="text-align: center;margin-top: 10px;">
                    <a href="javascript:void(0);" id="saveBtn" class="easyui-linkbutton button-primary">保存</a>
                    <a href="javascript:void(0);" id="resetBtn" class="easyui-linkbutton button-danger">重置</a>
                </td>
            </tr>
        </table>
    </form>
</section>
<script type="text/javascript" th:inline="none">
    $(function () {
        //重置按钮
        $("#resetBtn").on("click", function (event) {
            $("#form").form("reset");
        });
        //保存按钮
        $("#saveBtn").on("click", function (event) {
            $("#form").form("submit", {
                url: "/DictTypeAction_saveOrUpdate",
                onSubmit: function () {
                    //对表单进行数据校验,如果未通过校验，返回false，阻止表单提交
                    return $(this).form("validate");
                },
                success: function (data) {
                    //data未服务器端返回的字符串数据，eval将字符串数据转换为json对象
                    data = eval("(" + data + ")");
                    if (data.success) {
                        parent.closeTopWindow();
                    }
                }
            });
        });
    });
</script>
</body>
</html>
